

import { employeeListAll } from "@/api/employee";

export async function dialogsFunc() {
    const { data = [] } = await employeeListAll()
    const selects = data.map(item => {
        return {
            label: item.user_name,
            value: item.user_name
        }
    })

    return {
        fields: [
            {
                el: 'str-input',
                label: '部门名称',
                value: 'name',
                rule: { required: true },
                option: {}
            },
            {
                el: 'str-input',
                label: '编号',
                value: 'number',
                rule: { required: true },
                option: {}
            },
            {
                el: 'iv-select',
                label: '主管',
                value: 'user_name',
                rule: { required: true },
                option: {
                    selects
                }
            },
            {
                el: 'str-input',
                label: '备注',
                value: 'remark',
                rule: {},
                option: {
                    type: 'textarea'
                }
            },
        ]
    }
}
